angular.module('starter.controllers')

.controller('CoursesCtrl', function($rootScope, $scope, $ionicModal, $timeout,$window, Courses, MyLocalStorage) {
	Courses.getCourses($rootScope.getToken()).success(function (data, status, headers, config) {
  	$scope.courses = data;
  }).error(function (data, status, headers, config) {
  	
  });
  
  $scope.openCourse = function(id){
  	$window.location.href = ('#/app/playlists/' + id);
  };
	
});